package main

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"time"
)

func main() {

	r := gin.Default()
	r.LoadHTMLGlob("templates/*")

	// 静态资源 设置静态文件窗口
	//r.Static("static", "./static")

	// 动态请求
	r.GET("/timer", func(context *gin.Context) {
		now := time.Now().Unix()
		fmt.Println("now::", now)
		context.HTML(200, "timer.html", gin.H{
			"now": now,
		})
	})

	r.Run()

}
